<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body><table id="top_location_line" width="100%"><table id="top_location_line" width="100%"><tr width="100%"><td><a href="http://www.urchin.com"><img border="0" src="../images/google_sm.gif" width="135" height="41"></a></td><td width="100%"><span id="top_line" style="width: 100%; float: left; clear: both; border-bottom: 1px solid #CCC;"><span id="top_title" style="float: left; margin-top: 10px;"><b>Help Center</b></span></td></tr></table>
<div id="page" lang="en" dir="ltr">
<div dir="ltr" id="content" lang="en">
<p class="line867"><strong>Urchin 6 Installation Guide (FreeBSD and Linux)</strong> <ul><li style="list-style-type:none"><p class="line891"><em>This article authored by </em> <a href="EpikOne.html">EpikOne</a><em>, an Urchin Software Authorized Consultant </em> </li></ul><p class="line867"><strong>Before You Start: Important Note for Urchin 6.500 Users</strong> <p class="line874">Urchin 6.501 fixed several issues in the CPC scheduler that were introduced in Urchin 6.500. If you are upgrading from Urchin 6.500 to Urchin 6.602, the processed CPC data might be incorrect or incomplete, resulting in incorrect results in the Urchin reports. In order to get correct data from Google Adwords, we recommend that you either (a) install Urchin 6.602 in a new location or (b)if you wish to install on an existing 6.500 instance, delete the old CPC data. In this latter case, delete all contents of the following directories: <p class="line867"><pre>&lt;path_to_urchin_6500_installation&gt;/data/cpc/...
&lt;path_to_urchin_6500_installation&gt;/data/history/cpc/...
</pre><p class="line874">No action is required if you are not upgrading from Urchin 6.5 (i.e. 6.501 and later releases or from Urchin 6.402 and prior releases). <p class="line867"><strong>Before You Start - Important Note for FreeBSD Users</strong> <ul><li>FreeBSD has a hard-coded process datasize limit of 500MB, which is too small to allow Urchin to run due to the size of the geodata that has to be memory resident during log processing. The error you will see during runtime is: </li></ul><p class="line867"><pre>ERROR: (8011-323-1057) Failed to allocate memory
</pre><ul><li style="list-style-type:none">To address this, you'll need to increase the FreeBSD system's default process datasize, which you can do by editing the  /boot/loader.conf file and adding these lines: </li></ul><p class="line867"><pre># Increase max process data segment size to 1GB
kern.maxdsiz="1073741824"
</pre><ul><li style="list-style-type:none">You'll need to reboot afterwards. </li><li>FreeBSD has special driver called accf_http. It will buffer incoming connections until a certain complete HTTP requests arrive to speed up and optimize performance. By default this driver is not loaded to kernel and you will see the following warning: </li></ul><p class="line867"><pre>[warn] (2)No such file or directory: Failed to enable the ‘httpready’ Accept Filter
</pre><ul><li style="list-style-type:none">To avoid this, you'll need to enable the HTTP Accept Filter FreeBSD kernel module (accf_http), which you can do by editing the /boot/loader.conf file and adding these lines: </li></ul><p class="line867"><pre># Wait for full HTTP request accept filter
accf_http_load="YES"
</pre><ul><li style="list-style-type:none">You'll need to reboot afterwards. </li></ul><p class="line867"><strong>WARNING!!!</strong> Be very careful when changing system limits like this. If you set  kern.maxdsiz to be too large, your system may become unbootable. We <strong>strongly recommend</strong> that you read the FreeBSD documentation before making this modification, and assess the potential risks as they apply to your site-specific configuration. <p class="line867"><strong>Overview of Installation Steps</strong> <ul><li>Install the desired database server on the Urchin system or add Urchin's database to an existing server. Currently supported database engines: <ul><li>MySQL 5.0.3 or later (Note: Beginning with Urchin 6.6, MySQL 4.x.x is no longer supported) </li><li>PostgreSQL 8.2.5 or later </li></ul></li><li>Create the Urchin database and user in on the database server and grant access permissions </li><li>Unpack the Urchin distribution in a temporary directory </li><li>Run the install.sh script </li><li>License the Urchin installation </li></ul><p class="line867"><strong>Option 1: Using existing MySQL database with Urchin</strong> <ul><li><p class="line862">If you don't already have a MySQL server set up on your system, you can obtain a distribution from <a class="http" href="http://dev.mysql.com/downloads/">http://dev.mysql.com/downloads/</a> </li><li>Install the MySQL server per the instructions on the MySQL site </li><li>Make sure that you know the MySQL database administrator login (e.g. root) and password </li><li>Choose the database name, local MySQL user and password you will use with Urchin. Save this information, as you'll need it later during the Urchin installation. The example below creates a database named urchin and a MySQL user name urchin with password urchinpassword (but you should obviously choose your own password!) </li><li>Create the Urchin database, user and permissions with the following commands: </li></ul><p class="line867"><pre>root@yourserver# mysql -u root -p
mysql&gt; create database urchin character set utf8;
mysql&gt; GRANT ALL ON urchin.* to 'urchin'@'localhost' IDENTIFIED BY 'urchinpassword';
</pre><ul><li>Determine the pathname of the MySQL socket for communicating with your MySQL server. You can usually find this in the my.cnf file for your MySQL installation, look for the line that looks like socket=/var/lib/mysql/mysql.sock </li></ul><p class="line867"><strong>Option 2: Using existing PostgreSQL database with Urchin</strong> <ul><li><p class="line862">If you don't already have a PostgreSQL server set up on your system, you can obtain a distribution from <a class="http" href="http://www.postgresql.org">http://www.postgresql.org</a> . </li><li>Install the PostgreSQL server per the instructions on the PostgreSQL site </li><li>Make sure that the psql command is in your path and you know the PostgreSQL database administrator login (e.g. pgsql) and password </li><li>Choose the database name, local PostgreSQL user and password you will use with Urchin. Save this information, as you'll need it later during the Urchin installation. The example below creates a database named urchin and a PostgreSQL user name urchin with password urchinpass (but you should obviously choose your own password!) </li><li>Create the Urchin database, user and permissions with the following commands: </li></ul><p class="line867"><pre>root@yourserver# psql -U pgsql -d postgres
postgres=# CREATE DATABASE urchin WITH ENCODING 'UTF8';
postgres=# CREATE USER urchin WITH PASSWORD 'urchinpass';
postgres=# GRANT ALL ON DATABASE urchin TO urchin;
postgres=# \connect urchin;
postgres=# CREATE LANGUAGE 'PLPGSQL';
</pre><p class="line867"><strong>Option 3: Using bundled PostgreSQL server with Urchin</strong> <ul><li>Urchin 6.602 installer comes with bundled PostgreSQL server as an option during Urchin installation. </li><li>In order to use this option, Urchin installer should be invoked under user with root privileges. Installer will prompt you to provide port number and password for the user "postgres". Note: If the user "postgres" already exists in the system, then existing password needs to be provided. If user "postgres" doesn't exist in the system, it will be created with provided password. </li><li>The following limitations apply to the bundled PostgreSQL server: <ul><li>It can't be installed on FreeBSD. </li><li>It requires glibc version 2.3.3 or above. </li><li>It should not be installed in upgrade mode. </li><li>Root privileges are required for installation. </li></ul></li></ul><p class="line867"><strong>Installing Urchin</strong> <ul><li>Make sure that you have the Urchin database name, user and password that you selected above </li><li>Create a temporary directory and unpack the Urchin distribution into it: </li></ul><p class="line867"><pre>mkdir /var/tmp/urchintemp
cd /var/tmp/urchintemp
tar xzvf urchin6602_&lt;platform&gt;_installer.tar.gz
</pre><p class="line867"><strong>Important!</strong> To ensure correct installation, make sure that there is no 'active' instance of Urchin 6 on the target machine. Disable any existing version of Urchin 6 with the following command: <p class="line867"><pre>/path/to/urchin6/bin/urchinctl stop
</pre><ul><li>If you need to run multiple instances of Urchin 6 on the same machine, then the instances should (1) be installed in different locations, (2) have different web server ports and (3) connect to different databases. </li><li>Urchin copies all necessary files to the target folders and overwrites any existing files. In order to keep any existing customization intact, you'll need to install Urchin 6 in a new directory, or rename the existing installation directory. </li><li>Urchin 6.602 can either be installed from scratch or upgraded from an existing version of Urchin 6. <ul><li>During 'New' installation, Urchin prompts you for all configuration parameters, such as web server port, db configuration settings, etc. For 'upgrade', Urchin reuses the configuration of the existing Urchin 6 instance. </li><li><p class="line862">If you are installing bundled PostgreSQL server, then make sure that there is no existing PostgreSQL server on the system. To install, select an option "Install PostgreSQL" and provide PostgreSQL server details such as port number and administrator password.  <strong>Note:</strong> Please refer to <a class="http" href="http://www.postgresql.org">http://www.postgresql.org</a> if you have any problems installing the bundled PostgreSQL server. </li><li>Urchin 6.602 can only be used for upgrading certain earlier versions of Urchin 6. The following versions may be upgraded: <ul><li>Urchin 6.6 - Service Pack 1         : Version 6.601 </li><li>Urchin 6.6 - English Release         : Version 6.600 </li><li>Urchin 6.5 - Service Pack 2         : Version 6.501 </li><li>Urchin 6.5                                : Version 6.500 (see important note above) </li><li>Urchin 6 - Service Pack 1            : Version 6.402 </li><li>Urchin 6 - International Release    : Version 6.401 </li><li>Urchin 6 - English Release            : Version 6.400 </li></ul></li><li>During 'New' installation, Urchin prompts you to "Initialize database tables". If you want to keep an existing DB configuration, then select 'No'. In this case,Urchin preserves the existing configuration (by not recreating the existing tables), but it may need to create 'additional tables' or 'columns in existing tables'. </li></ul></li><li>Now run the Urchin installer. You can either run it interactively and follow the prompts by typing: </li></ul><p class="line867"><pre>./install.sh
</pre><p class="line874">or you can perform a complete install directly from the command line, supplying all the necessary parameters for the install. You can obtain a list of the command line parameters by typing: <p class="line867"><pre>./install.sh -h
</pre><ul><li>Once the installer completes, you'll have a running version of Urchin on your system. To finish the setup, point your favorite web browser at this URL: </li></ul><p class="line867"><pre>http://yourserver:&lt;port&gt;
</pre><p class="line862">where &lt;port&gt; is the network port you chose during the installation (default is 9999). <ul><li>If you wish to restore your profile reporting data from an older version of Urchin 6, copy the history, reports and any existing cpc directories from /path/to/old-urchin6/data/ to your new /path/to/new-urchin6/data/ directory. </li><li>Click on the Obtain Demo License link and follow the licensing steps to enable Urchin and perform the initial setup steps. </li></ul><p class="line867"><strong>Configuring Tracking</strong> <p class="line874">Once Urchin is installed, there may be additional steps required to set up tracking on your  website depending on your use case. <p class="line867"><strong>Case 1: Using Urchin with IP+User-Agent Tracking</strong> <p class="line874">No additional configuration is necessary. When adding profiles to Urchin, be sure to specify IP+User-Agent as the Visitor Tracking Method. <p class="line867"><strong>Case 2: Using Urchin with UTM Tracking</strong> <p class="line874">To use Urchin with UTM tracking, it is necessary to install a small piece of javascript tracking code on each of your website's pages. Here are the steps: <ul><li><p class="line862">Copy the urchin.js and <tt class="backtick">__</tt>utm.gif files from the util/utm directory of the Urchin  distribution to the document root of your website (e.g. the top level directory of your content) </li><li>On each page of your website, place the following tracking code right after the any META tags in the HEAD section: </li></ul><p class="line867"><pre>&lt;script src="/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
  _userv=0;
  urchinTracker();
&lt;/script&gt;
</pre><ul><li>When adding profiles to Urchin, be sure to specify Urchin Traffic Monitor (UTM) as the Visitor Tracking Method </li></ul><p class="line867"><strong>Case 3: Using Urchin concurrently with Google Analytics</strong> <p class="line874">Please note that the new tracking features in the Google Analytics "ga.js" tracking code are not backward compatible with Urchin 6. If you wish to track your website with both Google Analytics and Urchin Software, we recommend using the urchin.js-based tracking code for best results. If you choose to use ga.js, you will not be able to use the new ga.js tracking features. <p class="line874">To use Urchin with a website that is already being tracked with Google Analytics, you just need to make a slight modification to the existing tracking code for Google Analytics. Here are the steps: <ul><li><p class="line862">Copy only the <tt class="backtick">__</tt>utm.gif file from the util/utm directory of the Urchin distribution to the document root of your website (e.g. the top level directory of your content). </li><li><p class="line862">Add the line <tt>_userv=2;</tt> as shown below to the existing tracking code on your website pages. Be sure not to modify any other parts of the existing tracking code! </li></ul><p class="line867"><pre>&lt;script src="http://www.google-analytics.com/urchin.js"
type="text/javascript"&gt;
&lt;script type="text/javascript"&gt;
  _userv=2;
  _uacct="UA-XXXXXXX-Y";
  urchinTracker();
&lt;/script&gt;
</pre><ul><li>When adding profiles to Urchin, be sure to specify Urchin Traffic Monitor (UTM) as the Visitor Tracking Method </li></ul></div><div id="pagebottom"></div>
</div>


<div id="footer" style="clear: both; margin: 0; padding: 0; border-bottom:1px solid #CCC;"></div><div id="copyright" style="font-size: 70%; text-align: center;">&copy;2010 Google</div>
</body></html>